﻿/***************************************************
 * File name: SaleItemController.cs 
 * Author: Team A
 * Change Log: Please see SVN repository: http://test-project-drew1.googlecode.com/svn/trunk/
 * Date: December 2013
 * Description: See <summary> tab below
 * *************************************************/

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WSCeCommerce.Domain;
using WSCeCommerce.Helpers;
using WSCeCommerceWeb.Models;
using WSCeCommerceWeb;




namespace WSCeCommerceWeb.Controllers
{

    /// <summary>
    /// Controller used to link sales and items together. (Generated by MS and custmized by Team A)
    /// </summary>
    public class SaleItemController : Controller
    {
        // Customization: Renamed to be consistant with naming standards
        private WSCeCommerceDBContext _db = new WSCeCommerceDBContext();

        //
        // GET: /SaleItem/

        public ActionResult Index()
        {
            var cart = ShoppingCart.GetCart(this.HttpContext);

            // Set up our ViewModel

            var viewModel = new ShoppingCartViewModel
            {
                CartItems = cart.GetCartItems(),
                CartTotal = cart.GetTotal()
            };

            // Return the view

            return View(viewModel);


        }


    }
}